<?php

namespace app\admin\model\coupons;

use think\Model;


class Staff extends Model
{

    

    

    // 表名
    protected $name = 'coupons_clinic_staff';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
        'authorizedata_text'
    ];
    

    
    public function getAuthorizedataList()
    {
        return ['0' => __('Authorizedata 0'), '1' => __('Authorizedata 1'), '2' => __('Authorizedata 2')];
    }


    public function getAuthorizedataTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['authorizedata']) ? $data['authorizedata'] : '');
        $list = $this->getAuthorizedataList();
        return isset($list[$value]) ? $list[$value] : '';
    }

  public function user()
        {
            return $this->belongsTo('app\admin\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
        }
public function couponclinic()
    {
        return $this->belongsTo('app\admin\model\coupons\Clinic', 'coupon_clinic_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }


}